package org.hong.monkey.network

import org.hong.monkey.network.buffer.ManagedBuffer
import org.hong.monkey.storage.{BlockId, StorageLevel}

private[monkey]
trait BlockDataManager {

  /**
   * Interface to get local block data. Throws an exception if the block cannot be found or
   * cannot be read successfully.
   */
  def getBlockData(blockId: BlockId): ManagedBuffer

  /**
   * Put the block locally, using the given storage level.
   */
  def putBlockData(blockId: BlockId, data: ManagedBuffer, level: StorageLevel): Unit
}
